<?php
namespace app\tools\controller;

use app\BaseController;
use app\tools\logic\CommonLogic;
use app\tools\logic\ApiLogic;
use app\tools\logic\LoginLogic;

class Login extends BaseController{
    //登录
    function login(){
    	if(request()->isPost()){
            $rs = LoginLogic::toLogin();
            if($rs['code']>0){
                return ApiLogic::return($rs['code']); 
            }else{
                return ApiLogic::return($rs['code'], '', $rs['data']);
            }
            //开始登录
    	}else{
            //不允许的操作方法
	        return ApiLogic::return(10); 
    	}
    	
    }

    //退出登录
    function logout(){
    	return json(['code'=>0,'msg'=>'退出登录']);
    }


}
